#include <QtGui>

#include "qclickablestack.h"

//constructor
QClickableStack::QClickableStack(QWidget *parent)
        :QStackedWidget(parent)
{
    QWidget::setMouseTracking(true);
}

/* This method gets called when the mouse is pressed
 * In turn it emits a clicked signal which will be handled in the main window
 */
void QClickableStack::mousePressEvent(QMouseEvent *event)
{
   if(event->button() == Qt::LeftButton) //--- to check which button was pressed
        emit clicked();

}

/* This method gets called when the mouse is double clicked
 * In turn it emits a doubleClicked signal which will be handled in the main window
 */
void QClickableStack::mouseDoubleClickEvent(QMouseEvent *event)
{
    if(event->button() == Qt::LeftButton) //--- to check which button was pressed
        emit doubleClicked();
}


//destructor
QClickableStack::~QClickableStack()
{
    //no dynamic memory, so we do nothing here.
}
